home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #3 / Amiga Plus CD - 2002 - No. 03.iso / AmiSoft / Dev / Gui / Cit.lha / CIT / citra / CITFileRequest.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-02-13  |  2.8 KB  |  117 lines

  1. //
  2. //                     CITFileRequest include
  3. //
  4. //                             StormC
  5. //
  6. //                       version 2003.02.07
  7. //
  8.  
  9.  
  10. #ifndef CITFILEREQUEST_H
  11. #define CITFILEREQUEST_H TRUE
  12.  
  13. #include "CITPopUpWindow.h"
  14. #include "CITListBrowser.h"
  15. #include "CITString.h"
  16.  
  17. //
  18. // File Request Flags
  19. //
  20. #define CITFR_PATTERN         (1<<0)
  21. #define CITFR_SAVEFILE        (1<<1)
  22. #define CITFR_DIRS            (1<<2)
  23.  
  24.  
  25. typedef enum
  26. {
  27.   UPDATE_FILES,
  28.   UPDATE_VOLUMES
  29. }
  30. UpdateType;
  31.  
  32.  
  33.  
  34. class CITFileRequest:public CITPopUpWindow
  35. {
  36.   public:
  37.     CITFileRequest();
  38.  
  39.     void acceptText(char* t) {acceptLabel=t;}
  40.     void cancelText(char* t) {cancelLabel=t;}
  41.     void volumeText(char* t) {volumeLabel=t;}
  42.     void parentText(char* t) {parentLabel=t;}
  43.  
  44.     void  SaveRequest(BOOL b = TRUE) {if(b) fr_Flags|=CITFR_SAVEFILE else fr_Flags &=~CITFR_SAVEFILE;}
  45.     void  DirRequest(BOOL b=TRUE) {if(b) fr_Flags|=CITFR_DIRS else fr_Flags &=~CITFR_DIRS;}
  46.  
  47.     virtual void  Pattern(char* p);
  48.     virtual void  FullPath(char* p);
  49.     virtual void  Drawer(char* d);
  50.     virtual void  File(char* f);
  51.     virtual char* Drawer();
  52.     virtual char* File();
  53.  
  54.   protected:
  55.     virtual BOOL Create(CITScreen* CITScr);
  56.     virtual void Delete(); 
  57.  
  58.     virtual void listBrowserEvent(ULONG Id,ULONG eventFlag);
  59.     virtual void patternInpEvent(ULONG Id,ULONG eventFlag);
  60.     virtual void drawerInpEvent(ULONG Id,ULONG eventFlag);
  61.     virtual void fileInpEvent(ULONG Id,ULONG eventFlag);
  62.     virtual void volumeEvent(ULONG Id,ULONG eventFlag);
  63.     virtual void parentEvent(ULONG Id,ULONG eventFlag);
  64.  
  65.     virtual void updateView(UpdateType ut=UPDATE_FILES );
  66.     virtual void readFiles(CITList* fileList);
  67.     virtual void readVolumes(CITList* fileList);
  68.  
  69.     CITHGroup      userGroup;
  70.     CITListBrowser fileLB;
  71.  
  72.     CITString      patternInput;
  73.     CITString      drawerInput;
  74.     CITString      fileInput;
  75.     CITButton      volumeButton;
  76.     CITButton      parentButton;
  77.     CITList        lbList;
  78.  
  79.     ColumnInfo ci[5];    
  80.     
  81.     char* acceptLabel;
  82.     char* cancelLabel;
  83.     char* volumeLabel;
  84.     char* parentLabel;
  85.  
  86.     char file[110];
  87.     char drawer[256];
  88.     char pattern[128];
  89.  
  90.   private:
  91.     void _listBrowserEvent(ULONG Id,ULONG eventFlag);
  92.     void _patternInpEvent(ULONG Id,ULONG eventFlag);
  93.     void _drawerInpEvent(ULONG Id,ULONG eventFlag);
  94.     void _fileInpEvent(ULONG Id,ULONG eventFlag);
  95.     void _volumeEvent(ULONG Id,ULONG eventFlag);
  96.     void _parentEvent(ULONG Id,ULONG eventFlag);
  97.     BOOL displayName(char* name,char* pattern,UWORD type);
  98.     
  99.     ULONG fr_Flags;
  100. };
  101.  
  102.  
  103. //
  104. // File Node Types (also used as node priority)
  105. //
  106. #define TYPE_FILE       0
  107. #define TYPE_DIR        1
  108. #define TYPE_ASSIGN     2
  109. #define TYPE_VOLUME     3
  110.  
  111. enum
  112. {
  113.   FILEREQUESTCLASS_FLAGBITUSED = POPUPWINDOWCLASS_FLAGBITUSED
  114. };
  115.  
  116. #endif // CITFILEREQUEST_H
  117.